//
//  TLShortMoreBtnView.m
//  WXReader
//
//  Created by huaya on 2025/3/22.
//  Copyright © 2025 Andrew. All rights reserved.
//

#import "TLShortMoreBtnView.h"

@interface TLShortMoreBtnView ()

@property (weak, nonatomic) IBOutlet UIImageView *xlImgView;
@property (nonatomic, assign) bool changeImgViewStatus;
@end

@implementation TLShortMoreBtnView

+ (instancetype)createView {
    return [[[NSBundle mainBundle] loadNibNamed:@"TLShortMoreBtnView" owner:nil options:nil] lastObject];
}
- (void)awakeFromNib{
    [super awakeFromNib];
    self.changeImgViewStatus = NO;
    UITapGestureRecognizer *tapGest = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGestAction:)];
    
    [self addGestureRecognizer:tapGest];
    
    [self setUserInteractionEnabled:YES];
}
- (void)tapGestAction:(UITapGestureRecognizer *)tapG{
    if (self.didSelectedBlock) {
        self.didSelectedBlock();
    }
    [self changeImgView];
}
- (void)changeImgView{
    
    if (self.changeImgViewStatus) {
        self.xlImgView.transform = CGAffineTransformMakeRotation(0);
    }else{
        self.xlImgView.transform = CGAffineTransformMakeRotation(M_PI);
    }
    
    self.changeImgViewStatus = !self.changeImgViewStatus;
}
- (void)setDefultStatusImgView{
    self.changeImgViewStatus = YES;
    
    [self changeImgView];
}
@end
